package com.example.tao.smartcar;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

import com.example.tao.smartcar.bluetooth.BluetoothScanActivity;
import com.example.tao.smartcar.wifi.WifiConnectActivity;
import com.example.tao.smartcar.wifi.WifiModeChooseActivity;

public class ControlMethodChooseActivity extends BaseActivity implements View.OnClickListener {

    private LinearLayout mBluetoothControl, mWifiControl;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_control_method_choose);
        SmartCarApplication.getInstance().addActivity(this);

        setToolbar("", false);

        initView();
    }

    private void initView() {
        mBluetoothControl = (LinearLayout) this.findViewById(R.id.bluetooth_control);
        mWifiControl = (LinearLayout) this.findViewById(R.id.wifi_control);

        mBluetoothControl.setOnClickListener(this);
        mWifiControl.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.bluetooth_control :
                startActivity(new Intent(ControlMethodChooseActivity.this, BluetoothScanActivity.class));
                break;
            case R.id.wifi_control :
                startActivity(new Intent(ControlMethodChooseActivity.this, WifiModeChooseActivity.class));
                break;
        }
    }
}
